package com.stlm2.dems.dao.impl;

import org.springframework.stereotype.Repository;

import com.stlm2.dems.entity.IntegralOrder;
import com.stlm2.dems.dao.IntegralOrderDao;
import com.stlm2.core.base.impl.BaseDaoImpl;

import java.util.HashMap;
import java.util.Map;

@Repository("integralOrderDao")
public class IntegralOrderDaoImpl extends BaseDaoImpl<IntegralOrder> implements IntegralOrderDao {

    @Override
    public IntegralOrder getByCode(String code) {
        return selectOne("getByCode",code);
    }

    @Override
    public int integralOrderNum(Integer id, int i) {
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("userId",id);
        map.put("orderStateValue",i);
        return (Integer) _selectOne("integralOrderNum",map);
    }
}